<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<form action="newupload.php" method="post" enctype="multipart/form-data">
    请选择商品图片
    <input type="file" name="file" id="file" multiple="multiple"/>
    <br />
    <img src="" width="100px" height="100px" id="showImg" >
    <input type="submit" id="" value="提交" />
</form>
</body>

<script type="text/javascript">//图片在页面预览
    var fileObj = document.getElementById('file');
    function showImg() {

        var files = fileObj['files'];
        var URL = window.URL || window.webkitURL;
        var imgURL = URL.createObjectURL(files[0]);
        document.getElementById('showImg').src = imgURL;
    }
    onload = function(){
        console.log(fileObj);
        fileObj.onchange = showImg;
    }
</script>
</html>
<?php
echo '用户中心';
echo '<br />';
//判断cookies是否存在
if (!empty($_COOKIE['Token'])){
    echo '你的用户编码为：'.$_COOKIE['Token'];
}else{
    echo 'cookies值不存在！';
}
?>;
